#include <iostream>
#include "thread_pool.hpp"

using namespace std;

int main(int argc, char *argv[])
{
    ThreadPool pool(10);
    std::mutex mtx;

    cout << pool.is_free() << endl;

    for (int i = 0; i < 100; i++)
    {
        pool.submit([&, i]{
            lock_guard<mutex> guard(mtx);
            cout << "task " << i << " running...\n";
        });
    }

    while (!pool.is_free()) {}

    return 0;
}
